
********************************************************************************
** REPLICATION CODE FOR 
** Kuo/Bürgisser/Gallego/Häusermann, JEPP 2026
** Who wants to accelerate digitalization? Evidence from the next generation EU program
********************************************************************************

clear all
clear all
set mo off

use "JEPP_Kuoetal_2026.dta", clear

********************************************************************************
**ANALYSES***
********************************************************************************


********************************************************************************

***Descriptives

********************************************************************************

***FIGURE 2: Support for digitalization policies by country and policy
***How many people support it?
graph bar (mean) support_NG_digital_skills2c support_NG_5G2c support_NG_public_sector2c ///
support_NG_social_services2c support_NG_startups2c support_NG_companies2c, ///
over(country, sort(order)) ///
legend(cols(2) label(1 "Digital skills") ///
label(2 "5G")  label(3 "Public sector") ///
label(4 "Social services") label(5 "Startups ") ///
label(6 "Companies")) ///
bar(1, color(eltblue)) bar(2, color(edkblue)) bar(3, color(erose)) /// 
bar(4, color(maroon)) bar(5, color(eltgreen)) bar(6, color(emerald)) ///
blabel(bar, position(inside) format(%9.1f) color(white) size(vsmall)) ///
ytitle ("Support (0=Oppose or neutral; 1=Support)", size(small)) title("Support")


********************************************************************************

***FIGURE 3: Socio-structural correlates of support for digitalization policie
**Only hypothesized variables, without parties or trust in the EU

local socdem i.empl6c trust_EU i.born b5.country 

set scheme s1mono

*reg support_NG_avg i.place i.gender i.age_group i.KEoccupation Webb_ai_score01 Felten01 *RTI_Autor01  `socdem' , beta
*estimates store ke1

reg support_NG_avg i.place i.gender i.age_group i.KEoccupation Webb_ai_score01 Felten01 RTI_Autor01 i.income_quartile i.sector2  `socdem' , beta
estimates store ke1

reg support_NG_avg i.edu3c  
estimates store ke1edu

reg support_NG_avg i.place 
estimates store ke1place

reg support_NG_avg i.gender 
estimates store ke1gender

reg support_NG_avg i.age_group 
estimates store ke1age

reg support_NG_avg i.KEoccupation 
estimates store ke1occ

reg support_NG_avg Webb_ai_score01
estimates store ke1webb

reg support_NG_avg Felten01
estimates store ke1felten

reg support_NG_avg RTI_Autor01
estimates store ke1rti

reg support_NG_avg i.income_quartile 
estimates store ke1inc

reg support_NG_avg i.sector2
estimates store ke1sec

coefplot (ke1, label("All") pstyle(p4) msymbol(o)) ///
	(ke1place, pstyle(p2) msymbol(o)) ///
	(ke1gender, pstyle(p2) msymbol(o)) ///
	(ke1age, pstyle(p2) msymbol(o)) ///
	(ke1occ, pstyle(p2) msymbol(o)) ///
	(ke1webb, pstyle(p2) msymbol(o)) ///
	(ke1felten, pstyle(p2) msymbol(o)) ///
	(ke1rti, pstyle(p2) msymbol(o)) ///
	(ke1inc, pstyle(p2) msymbol(o)) ///
	(ke1sec, pstyle(p2) msymbol(o)), keep(*.edu3c *.place *.gender *.age_group *.KEoccupation ///
	 Webb_ai_score01 Felten01 RTI_Autor01 *.income_quartile *.sector2) ///
	bylabel(Support for policies)  ///
  xline(0) omitted baselevels  legend(off)  ///
    headings(1.edu3c = "{bf:Education}" ///
	1.place = "{bf:Place of residence}" ///
	0.gender = "{bf:Gender}" ///
	1.age_group = "{bf:Age}" ///
	0.KEoccupation  = "{bf:KE occupation}" ///
	Webb_ai_score01 = "{bf:Risk scores}" ///
	0.Webb_ai_score01 ///
	0.Felten01 ///
	0.RTI_Autor01 ///
	1.income_quartile = "{bf:Income quartile}" ///
	1.sector2 = "{bf:Sector}" , ///
	labsize(small) labcolor(cranberry) angle(horiz)) ///
	ysize(16) xsize(12) ///
	ylabel(,labsize(vsmall))  ///
	note( ///
	"In light gray: Coefficients from separate OLS models adding one main IV." ///
	"In dark gray: Coefficients from a single OLS model including all main IVs." ///
	"Controls:  employment situation, born in country, EU trust, country FE." ///
	, size(vsmall))
	


********************************************************************************

***FIGURE 4: Party Preference and Support for Digitalization Policies
*Parties

local socdem i.place i.gender i.age_group i.KEoccupation i.income_quartile i.empl6c i.born b5.country

reg support_NG_avg ib2.voteintfamily, beta
estimates store vote1

reg support_NG_avg ib2.voteintfamily `socdem', beta
estimates store vote2

reg support_NG_avg ib2.voteintfamily `socdem' trust_EU
estimates store vote3

coefplot (vote1, label("Without controls")) ///
         (vote2, label("Socio-demographic controls")) ///
         (vote3, label("With controls and EU trust")), ///
    keep(*.voteintfamily) ///
    xline(0) omitted baselevels ///
    headings(0.voteintfamily = "{bf:Vote intention}", ///
             labsize(small) labcolor(cranberry) angle(horiz)) ///
    ysize(8) xsize(11)



********************************************************************************

***FIGURE 5: Correlates of perceiving positive growth effects of digitalization policies 

reg nextgen_growth i.voteintfamily i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 
estimates store ke1

coefplot (ke1), ///
	keep(*.voteintfamily *income_quartile *.KEoccupation *.place *.gender *.age_group) ///
	bylabel(Support for policies)  ///
  xline(0) omitted baselevels  legend(off)  ///
    headings(1.voteintfamily = "{bf:Party choice}" ///
	1.income_quartile = "{bf:Income}" ///
	0.KEoccupation = "{bf:KE occupation}" ///
	1.place = "{bf:Place of residence}" ///
	0.gender = "{bf:Gender}" ///
	1.age_group = "{bf:Age}", ///
	labsize(small) labcolor(cranberry) angle(horiz)) ///
	ysize(16) xsize(12)  ///
	ylabel(,labsize(vsmall))


********************************************************************************



***FIGURE 6: Predicted probabilities of perceiving positive growth effects of digitalization policies, by party-family preference

*Change the labels for this graph
label define voteintfamily2 ///
	1 "Green" ///
	2 "Far Left" ///
	3 "Main Left" ///
	4 "Main Right" ///
	5 "Far right" ///
	6 "Other" ///
	, modify 
	
label values voteintfamily voteintfamily2

reg nextgen_growth i.voteintfamily i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 

margins i.voteintfamily, atmeans
marginsplot, recast(scatter) ///
	ytitle("Pred. prob to expect positive effects on growth") ///
	title("") ///
	xtitle("")	///
	ysize(6) xsize(8) 




********************************************************************************

***Figure 7: Determinants of perceiving positive effects of digitalization policies for manual workers vs. university graduates

local socdem i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 

reg nextgen_cons_manual i.voteintfamily `socdem' 
estimates store fig7a

reg nextgen_cons_university i.voteintfamily `socdem' 
estimates store fig7b

set scheme s1mono

coefplot (fig7a, label("Manual workers")) (fig7b, label("University graduates")), ///
		keep(*.voteintfamily *.income_quartile *.KEoccupation *.place *.gender *.age_group)  ///
  xline(0) omitted baselevels ///
    headings(1.voteintfamily = "{bf:Party choice}" ///
	1.income_quartile = "{bf:Income}" ///
	0.KEoccupation = "{bf:KE occupation}" ///
	1.place = "{bf:Place of residence}" ///
	0.gender = "{bf:Gender}" ///
	1.age_group = "{bf:Age}", ///
	labsize(small) labcolor(cranberry) angle(horiz)) ///
	ysize(16) xsize(12)  ///
	legend(size(small))	///
	ylabel(,labsize(small))



********************************************************************************

***Figure 8: Pred. probabilities of perceiving positive effects for manual workers (left) and for university graduates (right) by party preference


local socdem i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 

reg nextgen_cons_university i.voteintfamily `socdem' 

margins i.voteintfamily, atmeans
marginsplot, recast(scatter) ///
    yscale(range(.5 .8)) ///
    ylabel(.5(.1).8) ///
    ytitle("Pred. prob. to expect positive effects on university graduates") ///
    title("") ///
    xtitle("") ///
    ysize(6) xsize(8) ///
    name(g_university, replace)
	

local socdem i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 

reg nextgen_cons_manual i.voteintfamily `socdem' 

margins i.voteintfamily, atmeans
marginsplot, recast(scatter) ///
    yscale(range(.5 .8)) ///
    ylabel(.5(.1).8) ///
    ytitle("Pred. prob. to expect positive effects on manual workers") ///
    title("") ///
    xtitle("") ///
    ysize(6) xsize(8) ///
    name(g_manual, replace)


graph combine g_university g_manual, ///
    col(2) ///
    ycommon ///
    xsize(14) ysize(6)




********************************************************************************
************************************APPENDIX************************************
********************************************************************************

ssc install asdoc, replace

***Figure A1: Kernel density

kdensity support_NG_avg
graph save "figures/Figure 2a Distribution", replace
graph export "figures/Figure 2a Distribution.png", as(png) name("Graph") replace	


******Tables for the figures in the paper

***FIGURE 3

local socdem i.empl6c trust_EU i.born b5.country 

reg support_NG_avg i.place i.gender i.age_group i.KEoccupation Webb_ai_score01 Felten01 RTI_Autor01 i.income_quartile i.sector2  `socdem'
estimates store fig3

***FIGURE 4
local socdem i.place i.gender i.age_group i.KEoccupation  i.income_quartile  i.empl6c i.born b5.country

reg support_NG_avg  i.voteintfamily `socdem' 
eststo fig4a

reg support_NG_avg  i.voteintfamily `socdem' trust_EU
eststo fig4b

***FIGURE 5
reg nextgen_growth i.voteintfamily i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 
eststo fig5

***FIGURE 7 

local socdem i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 
reg nextgen_cons_manual i.voteintfamily `socdem' 
eststo fig7a

local socdem i.income_quartile i.KEoccupation i.place i.gender i.age_group b5.country 
reg nextgen_cons_university i.voteintfamily `socdem' 
eststo fig7b


***APPENDIX TABLE
esttab fig3 fig4a fig4b fig5 fig7a fig7b using figures.doc, ///
    replace rtf ///
    se star(* 0.1 ** 0.05 *** 0.01) ///
    stats(r2 N, labels("R-squared" "Observations")) ///
    title("Regression Models") ///
    mtitles("Figure 3 \line DV: Support Dig." ///
			"Figure 4 \line DV: Support Dig." ///
			"Figure 4 \line DV: Support Dig. \line With EU trust" ///
			"Figure 5 \line DV: Dig. Good for Growth" ///
			"Figure 7 \line DV: Dig. Good for manual workers" ///
			"Figure 7 \line DV: Dig. Good for university graduates") ///
	b(%9.3f) se(%9.3f) ///
    label
	
	
	
	

********************************************************************************
********************************************************************************
**RECODING OF RAW DATA FOR THE RESULTS OF THE PAPER ***
********************************************************************************
********************************************************************************

********************************************************************************
***Sociodemograhics

*country 
encode country, generate(countryN)
drop country 
rename countryN country
label variable country Country

*age - age
label variable age Age
label variable age_group "Age (4 groups)"
label variable age_group_3 "Age (3 groups)"

*education - edu_categories 
label variable edu_categories "Education (4 categories)"
drop edu_level

*education2

*female
label define female 0 "Male" 1 "Female"
label values female female
label variable female "Gender (female)"

*unemployed 
label variable unemployed "Situation: Unemployed"
label define unemployed 0 "Not unemployed" 1 "Unemployed", modify
label values unemployed unemployed

*foreign_born
label variable foreign_born "Foreign born"
label define foreign_born 0 "Not foreign born" 1 "Foreign born", modify
label values foreign_born foreign_born

*industry: to recode

*isco_code: to recode
*ssc install oesch

****Attitudinal

*voterecall
label variable voterecall "Voter turnout (last election)"
recode voterecall 0.5=2
label define voterecall 0 "Did not vote" 1 "Voted" 2 "Doesn't know", modify
label values voterecall voterecall

*Identity
label variable national_identity "National identity" 
label variable occupational_identity "Occupational identity" 
label variable gender_identity "Gender identity" 
label define identity 0 "Not important" 1 "A little important" ///
	2 "Somewhat important" 3 "Very important", modify
label values national_identity identity
label values gender_identity identity
label values occupational_identity identity

*Losing job
label variable perceived_risk_jobloss "Perceived risk of losing job"
label define perceived_risk_jobloss 0 "A small part (0-20%)" 1 "Almost all (80-100%)", modify
label variable perceived_risk_jobloss perceived_risk_jobloss

*Platform work
label define yesno 0 "No" 1 "Yes", modify
label values platform_work yesno
label variable platform_work "Has conducted platform work"

label variable platform_work_share "Percent income coming from platform work"
label define platform_work_share 0 "Very unlikely" 1 "Very likely", modify
label variable platform_work_share platform_work_share

*Outsideoptions: How is this labelled??
label variable perceived_outside_options "Perceived outside options"
label define perceived_outside_options 0 "?" 1 "?", modify
label variable perceived_outside_options perceived_outside_options


***Tech related
*Monitoring: Labeling?

*big_tech_sentiment_category  
label variable big_tech_sentiment "Sentiment about the Big Five tech companies (1-5)"
label define big_tech_sentiment 0 "Very negative" 1 "Very positive", modify
label values big_tech_sentiment big_tech_sentiment

*app_use_category
label variable app_use_category "How much do you use any services from platforms or apps (1-4)"

*online_retailer_use_category
label variable online_retailer_use_category "How much do you purchase goods or use services from large online retailers like Amazon? (1 to 4)" 

*tech_use_at_work_category
label variable tech_use_at_work_category "How much of your work time was spent using a computer or other device? (1 to 5)"

*tech_impact_on_work_category: 1 to 5
label variable tech_impact_on_work_category "Perceived consequences of technology in job (1 to 5)" 

*subj_substitution_risk
label variable subj_substitution_risk "Perceived risk of substitution"
label define proportion 0 "0%" 1 "100%", modify
label values subj_substitution_risk proportion

label variable subj_substitution_risk_category "Perceived proportion of tasks that could be automated (own job) in 5 categories"

*Globotics
label variable globotics "Concerned that your current job could be replaced by a person who telecommutes?"
label define globotics 0 "Not concerned" 1 "Very concerned", modify
label values globotics globotics

*Learn 
label variable learn1 "Frequency of needing to use new technologies at work"
label variable learn2 "Concerned about being outperformed by workers with more digital skills"
label variable learn3 "It is stressful to learn new digitial skills"

label define learn1 0 "Never" 1 "Frequently", modify
label define learn2 0 "Not concerned" 1 "Very concerned", modify
label define learn3 0 "Not stressful" 1 "Very stressful", modify
label values learn1 learn1
label values learn2 learn2
label values learn3 learn3

*Redistribution preferences
label variable support_social_policy_retraining "Support retraining programs"
label variable support_sp_unemp_benefits "Support unemployment benefits"
label variable support_sp_early_retire "Support early retirement"
label variable support_social_policy_UBI "Support unconditional minimum income"
label variable support_social_policy_avg "Support for redistributive preferences (additive 4 items)"

*subjectiveincome 
label variable perceived_income "Subjective income"
label define perceived_income 0	"Living very comfortably on present income" 1 "Finding it very difficult on present income", modify
label values perceived_income perceived_income

*condition_exp1

*Trust
label variable trust_labor_unions "Trust in labor unions"
label variable trust_national_government "Trust in national governments"
label variable trust_EU "Trust in the EU"
label variable trust_large_companies "Trust in large companies"
label variable trust_other_people "Trust in other people"
label variable trust_avg "Trust (additive 5 items)"
label define trust 0 "Strongly distrust" 1 "Strongly trust", modify
label values trust* trust

***Experiments 
*Experiments paper 1
label variable support_labor_unions "Give unions more power to decide"
label variable support_regulate_tech_progress "Make it harded for companies to adopt technologies that substitute jobs"
label variable support_regulate_gig_economy "More strongly regulate platform companies"
label variable support_monitoring_regulation "More regulations about monitoring technologies"
label variable support_tax_big_tech "Increase taxes on larger Internet retailers like Amazon"
label variable support_tax_tech_progress "Taxes and regulations on software, robots, or algorithms to substitute jobs"

*Trust
label variable trust_labor_unions "Trust in labor unions"
label variable trust_national_government "Trust in national governments"
label variable trust_EU "Trust in the EU"
label variable trust_large_companies "Trust in large companies"
label variable trust_other_people "Trust in other people"
label variable trust_avg "Trust (additive 5 items)"
label define trust 0 "Strongly distrust" 1 "Strongly trust", modify
label values trust* trust

***Experiments 
*Experiments paper 1
label variable support_labor_unions "Give unions more power to decide"
label variable support_regulate_tech_progress "Make it harded for companies to adopt technologies that substitute jobs"
label variable support_regulate_gig_economy "More strongly regulate platform companies"
label variable support_monitoring_regulation "More regulations about monitoring technologies"
label variable support_tax_big_tech "Increase taxes on larger Internet retailers like Amazon"
label variable support_tax_tech_progress "Taxes and regulations on software, robots, or algorithms to substitute jobs"

*Attitudes
label variable support_trade_protectionism "Supports trade protectionism"
label variable support_tax_fossils "Supports increase in tax fuels"
label variable support_welcome_migrants "Supports increasing the number of migrants"
label define support 0 "Negative support" 1 "Positive support", modify
label values support_* support

****Missing gender values

*Condition_exp1v x 
label variable condition_exp1 "Condition in information experiment"

*Condition_exp2
label variable condition_exp2 "Condition in Next Generation experiment"

*Experiment 2: Aspects of policy DV
label variable support_NG_digital_skills "NG priority: Offer digital skills courses to workers and unemployed people "
label variable support_NG_companies "NG priority: Help companies buy new digital services and equipment"
label variable support_NG_startups "NG priority: Support technological start-ups"
label variable support_NG_5G "NG priority: Installing fast-speed 5G mobile networks"
label variable support_NG_public_sector "NG priority: Digitalize public administration and services"
label variable support_NG_social_services "NG priority: Develop algorithms in socially relevant areas"
label variable support_NG_avg "NG priority: Average"

label variable nextgen_growth "NG: Perceived impact on economic growth"
label define nextgen_growth 0 "Very negative" 1 "Very positive", modify
label values nextgen_growth nextgen_growth

label variable nextgen_cons_manual "NG: Impact on people doing physically tiring, manual work "
label variable nextgen_cons_cognitive_creative "NG: Impact on people doing cognitive, creative work"
label variable nextgen_cons_university "NG: Impact on university-educated people"
label variable nextgen_cons_young "NG: Impact on young people (18-34)"
label variable nextgen_cons_old "NG: Impact on middle-aged people (35-54)"
label variable nextgen_cons_rural "NG: Impact on people in the countryside"
label variable nextgen_cons_urban "NG: Impact on people in the city"
label define nextgen_cons 0 "Negative" 1 "Positive"
label values nextgen_cons* nextgen_cons

***Orde
*Condition_exp1v x 
label variable condition_exp1 "Condition in information experiment"

*Condition_exp2
label variable condition_exp2 "Condition in Next Generation experiment"

*Experiment 2: Aspects of policy DV
label variable support_NG_digital_skills "NG priority: Offer digital skills courses to workers and unemployed people "
label variable support_NG_companies "NG priority: Help companies buy new digital services and equipment"
label variable support_NG_startups "NG priority: Support technological start-ups"
label variable support_NG_5G "NG priority: Installing fast-speed 5G mobile networks"
label variable support_NG_public_sector "NG priority: Digitalize public administration and services"
label variable support_NG_social_services "NG priority: Develop algorithms in socially relevant areas"
label variable support_NG_avg "NG priority: Average"

label variable nextgen_growth "NG: Perceived impact on economic growth"
label define nextgen_growth 0 "Very positive" 1 "Very negative", modify
label values nextgen_growth nextgen_growth

label variable nextgen_cons_manual "NG: Impact on people doing physically tiring, manual work "
label variable nextgen_cons_cognitive_creative "NG: Impact on people doing cognitive, creative work"
label variable nextgen_cons_university "NG: Impact on university-educated people"
label variable nextgen_cons_young "NG: Impact on young people (18-34)"
label variable nextgen_cons_old "NG: Impact on middle-aged people (35-54)"
label variable nextgen_cons_rural "NG: Impact on people in the countryside"
label variable nextgen_cons_urban "NG: Impact on people in the city"
label define nextgen_cons 0 "Negative" 1 "Positive", modify
label values nextgen_cons* nextgen_cons


****
rename female	gender
rename edu_categories	education
rename foreign_born	born
rename support_trade_protectionism 	inttrade
rename support_tax_fossils	climate
rename support_welcome_migrants	migrants
rename voterecall	voterecall
rename perceived_income	subjectiveincome
rename perceived_risk_jobloss	losingjob
rename perceived_outside_options	outsideoptions	
rename platform_work 	platformwork1
rename platform_work_share	platformwork2
rename app_use_category	appuse
rename online_retailer_use_category	onlineretailers
rename tech_use_at_work_category	techworkuse
rename tech_impact_on_work_category	techoptimism
rename big_tech_sentiment_category	techfirmsentiment
rename support_labor_unions	exp_tradeunions
rename support_regulate_tech_progress	exp_regulation
rename support_regulate_gig_economy	exp_regulateplatforms
rename support_monitoring_regulation	exp_monitoring
rename support_tax_big_tech	exp_amazon
rename support_tax_tech_progress	exp_algorithm
	
rename support_social_policy_retraining redist1
rename support_sp_unemp_benefits redist2
rename support_sp_early_retire redist3
rename support_social_policy_UBI redist4
rename support_social_policy_avg	redist_avg
	
label variable techworkuse "Technology use at work"

label variable worktasks "Tasks at low automation risk"

label variable Webb_ai_score "AI exposure Webb"
label variable Webb_software_score "Software exposure Webb" 
label variable Webb_robot_score "Robot exposure Webb"
label variable RTI_Autor "Routine task intensity Autor"
label variable Brynjolfson "Suitability machine learning Brynjolfson"
label variable Felten "AI  exposure Felten"
label variable Tolan "AI exposure Tolan"
label variable Meindl "Exposure Fourth Ind. Rev. Meindl"
label variable Frey_Osborne "Automation risk Frey and Osborne"

label variable support_tech_protectionism_avg "Tech protectionism"
label variable globotics  "Globotics concern"
label variable techoptimism  "Optimism tech impact work"
label variable techfirmsentiment  "Big tech sentiment"
label variable subj_substitution_risk  "Subjective substitution risk"
label variable learn1  "Needs to use new tech at work"
label variable learn2  "Concern being outperformed"
label variable learn3  "Stressed when learning tech"
label variable techno_stress "Technostress"
label variable techno_stressed2 "Technostress 3"


recode techoptimism 1=0 2=0.25 3=0.5 4=0.75 5=1, gen(techoptimism01)
recode techfirmsentiment 1=0 2=0.25 3=0.5 4=0.75 5=1, gen(techfirmsentiment01)
label variable techoptimism01  "Optimism tech impact work"
label variable techfirmsentiment01  "Big tech sentiment"

		   
drop Gender
rename employment_categories empl6c
label variable empl6c "Employment situation (6 categories)"
order empl6c, after (education)
drop employment umemployment uemployed

*label define empl5c 1 "Long-term contract" 2 "Temporary contract" ///
*	3 "Self-employed" 4 "Unemployed" 5 "Student" 6 "Pensioner" 7 "Other", modify
*label values empl5c empl5c

encode sector, generate(sector2)

*This label is reversed, check!!
tab nextgen_growth
label define nextgen_growth 1 "Very positive" 0 "Very negative", modify
label values nextgen_growth nextgen_growth
 
tab nextgen_knowledge
recode nextgen_knowledge 2=0
label define yesno 0 "No" 1 "Yes", modify
label values nextgen_knowledge yesno
 
gen nextgen_knowledge100=nextgen_knowledge*100

gen nextgen_growth10=nextgen_growth*10

generate order = 1 if country==3
replace order = 2 if country==4
replace order = 3 if country==2
replace order = 4 if country==5
replace order = 5 if country==1

gen support_NG_digital_skills10 = support_NG_digital_skills * 10
gen support_NG_5G10 = support_NG_5G * 10
gen support_NG_public_sector10 = support_NG_public_sector * 10
gen support_NG_social_services10 = support_NG_social_services * 10
gen support_NG_startups10 = support_NG_startups * 10
gen support_NG_companies10 = support_NG_companies * 10
gen support_NG_avg10 = support_NG_avg * 10

recode support_NG_digital_skills 0.25=1 0.5=2 0.75=3 1=4, gen(support_NG_digital_skills5c)
recode support_NG_5G 0.25=1 0.5=2 0.75=3 1=4, gen(support_NG_5G5c)
recode support_NG_public_sector 0.25=1 0.5=2 0.75=3 1=4, gen(support_NG_public_sector5c)
recode support_NG_social_services 0.25=1 0.5=2 0.75=3 1=4, gen(support_NG_social_services5c)
recode support_NG_startups 0.25=1 0.5=2 0.75=3 1=4, gen(support_NG_startups5c)
recode support_NG_companies 0.25=1 0.5=2 0.75=3 1=4, gen(support_NG_companies5c)

recode support_NG_digital_skills 0.25=0 0.5=0 0.75=1 1=1, gen(support_NG_digital_skills2c)
recode support_NG_5G 0.25=0 0.5=0 0.75=1 1=1, gen(support_NG_5G2c)
recode support_NG_public_sector 0.25=0 0.5=0 0.75=1 1=1, gen(support_NG_public_sector2c)
recode support_NG_social_services 0.25=0 0.5=0 0.75=1 1=1, gen(support_NG_social_services2c)
recode support_NG_startups 0.25=0 0.5=0 0.75=1 1=1, gen(support_NG_startups2c)
recode support_NG_companies 0.25=0 0.5=0 0.75=1 1=1, gen(support_NG_companies2c)

recode support_NG_digital_skills 0=1 0.25=1 0.5=0 0.75=0 1=0, gen(support_NG_digital_skills2cb)
recode support_NG_5G 0=1 0.25=1 0.5=0 0.75=0 1=0, gen(support_NG_5G2cb)
recode support_NG_public_sector 0=1 0.25=1 0.5=0 0.75=0 1=0, gen(support_NG_public_sector2cb)
recode support_NG_social_services 0=1 0.25=1 0.5=0 0.75=0 1=0, gen(support_NG_social_services2cb)
recode support_NG_startups 0=1 0.25=1 0.5=0 0.75=0 1=0, gen(support_NG_startups2cb)
recode support_NG_companies 0=1 0.25=1 0.5=0 0.75=0 1=0, gen(support_NG_companies2cb)

recode nextgen_cons_cognitive_creative 0.5=0, gen(nextgen_cognitive_2c)
recode nextgen_cons_manual 0.5=0, gen(nextgen_manual_2c)
recode nextgen_cons_young 0.5=0, gen(nextgen_young_2c)
recode nextgen_cons_old 0.5=0, gen(nextgen_old_2c)
recode nextgen_cons_urban 0.5=0, gen(nextgen_urban_2c)
recode nextgen_cons_rural  0.5=0, gen(nextgen_rural_2c)
recode nextgen_cons_university 0.5=0, gen(nextgen_university_2c)

recode nextgen_cons_cognitive_creative 0 =1 0.5=0 1=0, gen(nextgen_cognitive_2cB)
recode nextgen_cons_manual 0 =1 0.5=0 1=0, gen(nextgen_manual_2cB)
recode nextgen_cons_young 0 =1 0.5=0 1=0, gen(nextgen_young_2cB)
recode nextgen_cons_old 0 =1 0.5=0 1=0, gen(nextgen_old_2cB)
recode nextgen_cons_urban 0 =1 0.5=0 1=0, gen(nextgen_urban_2cB)
recode nextgen_cons_rural  0 =1 0.5=0 1=0, gen(nextgen_rural_2cB)
recode nextgen_cons_university 0 =1 0.5=0 1=0, gen(nextgen_university_2cB)

recode nextgen_cons_cognitive_creative (0.5=1) (1=2), gen(nextgen_cognitive_3c)
recode nextgen_cons_manual (0.5=1) (1=2), gen(nextgen_manual_3c)
recode nextgen_cons_young (0.5=1) (1=2), gen(nextgen_young_3c)
recode nextgen_cons_old (0.5=1) (1=2), gen(nextgen_old_3c)
recode nextgen_cons_urban (0.5=1) (1=2), gen(nextgen_urban_3c)
recode nextgen_cons_rural  (0.5=1) (1=2), gen(nextgen_rural_3c)
recode nextgen_cons_university (0.5=1) (1=2), gen(nextgen_university_3c)

label define l3c 0 "Negative" 1 "Neutral" 2 "Positive", modify
label values nextgen_cognitive_3c l3c
label values nextgen_manual_3c l3c
label values nextgen_young_3c l3c
label values nextgen_old_3c l3c
label values nextgen_urban_3c l3c
label values nextgen_rural_3c l3c
label values nextgen_university_3c l3c

label variable nextgen_cognitive_2c "On cognitive workers"
label variable nextgen_manual_2c "On manual workers"
label variable nextgen_young_2c "On young people"
label variable nextgen_old_2c "On old people"
label variable nextgen_urban_2c "On urban people"
label variable nextgen_rural_2c "On rural people"
label variable nextgen_university_2c "On university educated"

label variable nextgen_cognitive_2cB "On cognitive workers"
label variable nextgen_manual_2cB "On manual workers"
label variable nextgen_young_2cB "On young people"
label variable nextgen_old_2cB "On old people"
label variable nextgen_urban_2cB "On urban people"
label variable nextgen_rural_2cB "On rural people"
label variable nextgen_university_2cB "On university educated"

label variable nextgen_cognitive_3c "On cognitive workers"
label variable nextgen_manual_3c "On manual workers"
label variable nextgen_young_3c "On young people"
label variable nextgen_old_3c "On old people"
label variable nextgen_urban_3c "On urban people"
label variable nextgen_rural_3c "On rural people"
label variable nextgen_university_3c "On university educated"

recode education (4=3), gen(edu3c)
label variable edu3c "Education (3 categories)"
label define edu3c 1 "Lower" 2 "Vocational" 3 "University", modify
label values edu3c edu3c

label variable income_quartile "Income quartile"
recode income_quartile 1=4 2=3 3=2 4=1 
label define income_quartile 4 "4th quartile (highest)" 3 "3rd quartile" 2 "2nd quartile" 1 "1st quartile (lowest)", modify
label values income_quartile income_quartile

label define place 1 "Countryside" 2 "Country village" 3 "Town or small city" ///
4 "Suburbs big city" 5 "Big city", modify
label values place place

label define condition_exp2 ///
	1 "Control" ///
	2 "Distributional prime" ///
	3 "Growth prime" ///
	4 "Both primes", modify
label values condition_exp2 condition_exp2

label variable support_NG_avg "Support NG (average)"
label variable redist_avg "Support for redistribution"

label variable polint "Political interest"
label variable big_tech_sentiment "Big tech sentiment"
label variable inttrade "Supports protectionism"
label variable climate  "Supports tax fuels"
label variable migrants "Supports more migrants"

label variable appuse "App use (platforms))"
label variable onlineretailers "Buys online" 
label variable platformwork1  "Works for platform"
label variable learn2 "Concern being outperformed"
label variable learn3 "Technostress"

label variable gendervalues "Gender equality"

encode occupation_1d, generate(occupationenc)
recode  occupationenc 1=1 2=1 3=1 4=1 5=0 6=0 7=0 8=0 9=0, gen(cogcreat)
label variable cogcreat "Cognitive or creative"
label define cogcreat 1 "In cognitive or creative" 0 "Not in cognitive or creative", modify
label values cogcreat cogcreat

recode  occupationenc 1=1 2=1 3=1 4=0 5=0 6=0 7=0 8=0 9=0, gen(cogcreatB)
label variable cogcreatB "Cognitive or creative occupation"
label define cogcreatB 1 "In cognitive or creative occupation"
label values cogcreatB cogcreatB

gen gap_cogncreat = nextgen_cons_cognitive_creative - nextgen_cons_manual 
gen gap_youngold = nextgen_cons_young - nextgen_cons_old 
gen gap_urbanrural = nextgen_cons_urban - nextgen_cons_rural  

gen impactgappre = (nextgen_cons_cognitive_creative + nextgen_cons_young + ///
nextgen_cons_urban + nextgen_cons_university) - (nextgen_cons_manual + nextgen_cons_old + nextgen_cons_rural)
gen impactgap = (impactgappre +2.5)/6.5

*gen nextgen_cons_avg = (nextgen_cons_manual + nextgen_cons_cognitive_creative + nextgen_cons_university + nextgen_cons_young + nextgen_cons_old + nextgen_cons_rural + nextgen_cons_urban)/7

gen nextgen_cons_high = (nextgen_cons_cognitive_creative + nextgen_cons_university + nextgen_cons_young  + nextgen_cons_urban)/4

gen nextgen_cons_low = (nextgen_cons_manual + nextgen_cons_old + nextgen_cons_rural  )/3

encode intention_party_coding, gen(voteintfamily)

label define voteintfamily 1 "Green" 2 "Far Left" 3 "Mainstr. Left" 4 "Mainstr. Right" 5 "other" 6 "Far Right", modify

*Experiment 3
encode Rec_ech, gen(exp3A)
encode Rec_ech2, gen(exp3B)
rename Rec_ech3 exp3C

*Cosmopolitanism

factor gendervalues inttrade climate migrants
predict cosmopolitan1
label variable cosmopolitan1 "Cosmopolitan values"

factor  inttrade climate migrants
predict cosmopolitan2 
label variable cosmopolitan2 "Cosmopolitan values"

gen cosmopolitan= (cosmopolitan2 + 1.304589) / (1.853106 + 1.304589)
label variable cosmopolitan "Cosmopolitan"

*Industry
rename industry industrypre
encode industrypre, gen(industry)

recode industry (1/9=0) (10=1) (11/15=0), gen(ictindustry)
label variable ictindustry "In ICT industry"

*Occupational

encode occupation_1d, gen(occupation1d)

label define occ1d 1 "Managers" 2 "Professionals" 3 "Technicians" ///
	4 "Clerical" 5 "Service and sales" 6 "Skilled agricultural" 7 "Craft and trades" ///
	8 "Machines operators" 9 "Elementary", modify
	
label values occupation1d occ1d 

label variable occupation1d "Occupation"


destring occupation, generate(ictocc)

recode ictocc (	1111	=	0	)
recode ictocc (	1112	=	0	)
recode ictocc (	1113	=	0	)
recode ictocc (	1114	=	0	)
recode ictocc (	1120	=	0	)
recode ictocc (	1211	=	0	)
recode ictocc (	1212	=	0	)
recode ictocc (	1213	=	0	)
recode ictocc (	1219	=	0	)
recode ictocc (	1221	=	0	)
recode ictocc (	1222	=	0	)
recode ictocc (	1223	=	0	)
recode ictocc (	1311	=	0	)
recode ictocc (	1312	=	0	)
recode ictocc (	1321	=	0	)
recode ictocc (	1322	=	0	)
recode ictocc (	1323	=	0	)
recode ictocc (	1324	=	0	)
recode ictocc (	1330	=	1	)
recode ictocc (	1341	=	0	)
recode ictocc (	1342	=	0	)
recode ictocc (	1343	=	0	)
recode ictocc (	1344	=	0	)
recode ictocc (	1345	=	0	)
recode ictocc (	1346	=	0	)
recode ictocc (	1349	=	0	)
recode ictocc (	1411	=	0	)
recode ictocc (	1412	=	0	)
recode ictocc (	1420	=	0	)
recode ictocc (	1431	=	0	)
recode ictocc (	1439	=	0	)
recode ictocc (	211	=	0	)
recode ictocc (	2111	=	0	)
recode ictocc (	2112	=	0	)
recode ictocc (	2113	=	0	)
recode ictocc (	2114	=	0	)
recode ictocc (	2120	=	0	)
recode ictocc (	2131	=	0	)
recode ictocc (	2132	=	0	)
recode ictocc (	2133	=	0	)
recode ictocc (	2141	=	0	)
recode ictocc (	2142	=	0	)
recode ictocc (	2143	=	0	)
recode ictocc (	2144	=	0	)
recode ictocc (	2145	=	0	)
recode ictocc (	2146	=	0	)
recode ictocc (	2149	=	0	)
recode ictocc (	2151	=	0	)
recode ictocc (	2152	=	1	)
recode ictocc (	2153	=	1	)
recode ictocc (	2161	=	0	)
recode ictocc (	2162	=	0	)
recode ictocc (	2163	=	0	)
recode ictocc (	2164	=	0	)
recode ictocc (	2165	=	0	)
recode ictocc (	2166	=	1	)
recode ictocc (	2211	=	0	)
recode ictocc (	2212	=	0	)
recode ictocc (	2221	=	0	)
recode ictocc (	2222	=	0	)
recode ictocc (	2230	=	0	)
recode ictocc (	2240	=	0	)
recode ictocc (	2250	=	0	)
recode ictocc (	2261	=	0	)
recode ictocc (	2262	=	0	)
recode ictocc (	2263	=	0	)
recode ictocc (	2264	=	0	)
recode ictocc (	2265	=	0	)
recode ictocc (	2266	=	0	)
recode ictocc (	2267	=	0	)
recode ictocc (	2269	=	0	)
recode ictocc (	2310	=	0	)
recode ictocc (	2320	=	0	)
recode ictocc (	2330	=	0	)
recode ictocc (	2341	=	0	)
recode ictocc (	2342	=	0	)
recode ictocc (	2351	=	0	)
recode ictocc (	2352	=	0	)
recode ictocc (	2353	=	0	)
recode ictocc (	2354	=	0	)
recode ictocc (	2355	=	0	)
recode ictocc (	2356	=	1	)
recode ictocc (	2359	=	0	)
recode ictocc (	2411	=	0	)
recode ictocc (	2412	=	0	)
recode ictocc (	2413	=	0	)
recode ictocc (	2421	=	0	)
recode ictocc (	2422	=	0	)
recode ictocc (	2423	=	0	)
recode ictocc (	2424	=	0	)
recode ictocc (	2431	=	0	)
recode ictocc (	2432	=	0	)
recode ictocc (	2433	=	0	)
recode ictocc (	2434	=	1	)
recode ictocc (	2511	=	1	)
recode ictocc (	2512	=	1	)
recode ictocc (	2513	=	1	)
recode ictocc (	2514	=	1	)
recode ictocc (	2519	=	1	)
recode ictocc (	2521	=	1	)
recode ictocc (	2522	=	1	)
recode ictocc (	2523	=	1	)
recode ictocc (	2529	=	1	)
recode ictocc (	2611	=	0	)
recode ictocc (	2612	=	0	)
recode ictocc (	2619	=	0	)
recode ictocc (	2621	=	0	)
recode ictocc (	2622	=	0	)
recode ictocc (	2631	=	0	)
recode ictocc (	2632	=	0	)
recode ictocc (	2633	=	0	)
recode ictocc (	2634	=	0	)
recode ictocc (	2635	=	0	)
recode ictocc (	2636	=	0	)
recode ictocc (	2641	=	0	)
recode ictocc (	2642	=	0	)
recode ictocc (	2643	=	0	)
recode ictocc (	2651	=	0	)
recode ictocc (	2652	=	0	)
recode ictocc (	2653	=	0	)
recode ictocc (	2654	=	0	)
recode ictocc (	2655	=	0	)
recode ictocc (	2656	=	0	)
recode ictocc (	2659	=	0	)
recode ictocc (	3111	=	0	)
recode ictocc (	3112	=	0	)
recode ictocc (	3113	=	0	)
recode ictocc (	3114	=	1	)
recode ictocc (	3115	=	0	)
recode ictocc (	3116	=	0	)
recode ictocc (	3117	=	0	)
recode ictocc (	3118	=	0	)
recode ictocc (	3119	=	0	)
recode ictocc (	3121	=	0	)
recode ictocc (	3122	=	0	)
recode ictocc (	3123	=	0	)
recode ictocc (	3131	=	0	)
recode ictocc (	3132	=	0	)
recode ictocc (	3133	=	0	)
recode ictocc (	3134	=	0	)
recode ictocc (	3135	=	0	)
recode ictocc (	3139	=	0	)
recode ictocc (	3141	=	0	)
recode ictocc (	3142	=	0	)
recode ictocc (	3143	=	0	)
recode ictocc (	315	=	0	)
recode ictocc (	3151	=	0	)
recode ictocc (	3152	=	0	)
recode ictocc (	3153	=	0	)
recode ictocc (	3154	=	0	)
recode ictocc (	3155	=	0	)
recode ictocc (	3211	=	0	)
recode ictocc (	3212	=	0	)
recode ictocc (	3213	=	0	)
recode ictocc (	3214	=	0	)
recode ictocc (	3221	=	0	)
recode ictocc (	3222	=	0	)
recode ictocc (	3230	=	0	)
recode ictocc (	3240	=	0	)
recode ictocc (	3251	=	0	)
recode ictocc (	3252	=	0	)
recode ictocc (	3253	=	0	)
recode ictocc (	3254	=	0	)
recode ictocc (	3255	=	0	)
recode ictocc (	3256	=	0	)
recode ictocc (	3257	=	0	)
recode ictocc (	3258	=	0	)
recode ictocc (	3259	=	0	)
recode ictocc (	3311	=	0	)
recode ictocc (	3312	=	0	)
recode ictocc (	3313	=	0	)
recode ictocc (	3314	=	0	)
recode ictocc (	3315	=	0	)
recode ictocc (	3321	=	0	)
recode ictocc (	3322	=	0	)
recode ictocc (	3323	=	0	)
recode ictocc (	3324	=	0	)
recode ictocc (	3331	=	0	)
recode ictocc (	3332	=	0	)
recode ictocc (	3333	=	0	)
recode ictocc (	3334	=	0	)
recode ictocc (	3339	=	0	)
recode ictocc (	3341	=	0	)
recode ictocc (	3342	=	0	)
recode ictocc (	3343	=	0	)
recode ictocc (	3344	=	0	)
recode ictocc (	3351	=	0	)
recode ictocc (	3352	=	0	)
recode ictocc (	3353	=	0	)
recode ictocc (	3354	=	0	)
recode ictocc (	3355	=	0	)
recode ictocc (	3359	=	0	)
recode ictocc (	3411	=	0	)
recode ictocc (	3412	=	0	)
recode ictocc (	3413	=	0	)
recode ictocc (	3421	=	0	)
recode ictocc (	3422	=	0	)
recode ictocc (	3423	=	0	)
recode ictocc (	3431	=	0	)
recode ictocc (	3432	=	0	)
recode ictocc (	3433	=	0	)
recode ictocc (	3434	=	0	)
recode ictocc (	3435	=	0	)
recode ictocc (	3511	=	1	)
recode ictocc (	3512	=	1	)
recode ictocc (	3513	=	1	)
recode ictocc (	3514	=	1	)
recode ictocc (	3521	=	1	)
recode ictocc (	3522	=	1	)
recode ictocc (	4110	=	0	)
recode ictocc (	4120	=	0	)
recode ictocc (	4131	=	0	)
recode ictocc (	4132	=	0	)
recode ictocc (	4211	=	0	)
recode ictocc (	4212	=	0	)
recode ictocc (	4213	=	0	)
recode ictocc (	4214	=	0	)
recode ictocc (	4221	=	0	)
recode ictocc (	4222	=	0	)
recode ictocc (	4223	=	0	)
recode ictocc (	4224	=	0	)
recode ictocc (	4225	=	0	)
recode ictocc (	4226	=	0	)
recode ictocc (	4227	=	0	)
recode ictocc (	4229	=	0	)
recode ictocc (	4311	=	0	)
recode ictocc (	4312	=	0	)
recode ictocc (	4313	=	0	)
recode ictocc (	4321	=	0	)
recode ictocc (	4322	=	0	)
recode ictocc (	4323	=	0	)
recode ictocc (	4411	=	0	)
recode ictocc (	4412	=	0	)
recode ictocc (	4413	=	0	)
recode ictocc (	4414	=	0	)
recode ictocc (	4415	=	0	)
recode ictocc (	4416	=	0	)
recode ictocc (	4419	=	0	)
recode ictocc (	5111	=	0	)
recode ictocc (	5112	=	0	)
recode ictocc (	5113	=	0	)
recode ictocc (	5120	=	0	)
recode ictocc (	5131	=	0	)
recode ictocc (	5132	=	0	)
recode ictocc (	5141	=	0	)
recode ictocc (	5142	=	0	)
recode ictocc (	5151	=	0	)
recode ictocc (	5152	=	0	)
recode ictocc (	5153	=	0	)
recode ictocc (	5161	=	0	)
recode ictocc (	5162	=	0	)
recode ictocc (	5163	=	0	)
recode ictocc (	5164	=	0	)
recode ictocc (	5165	=	0	)
recode ictocc (	5169	=	0	)
recode ictocc (	5211	=	0	)
recode ictocc (	5212	=	0	)
recode ictocc (	5221	=	0	)
recode ictocc (	5222	=	0	)
recode ictocc (	5223	=	0	)
recode ictocc (	5230	=	0	)
recode ictocc (	5241	=	0	)
recode ictocc (	5242	=	0	)
recode ictocc (	5243	=	0	)
recode ictocc (	5244	=	0	)
recode ictocc (	5245	=	0	)
recode ictocc (	5246	=	0	)
recode ictocc (	5249	=	0	)
recode ictocc (	5311	=	0	)
recode ictocc (	5312	=	0	)
recode ictocc (	5321	=	0	)
recode ictocc (	5322	=	0	)
recode ictocc (	5329	=	0	)
recode ictocc (	5411	=	0	)
recode ictocc (	5412	=	0	)
recode ictocc (	5413	=	0	)
recode ictocc (	5414	=	0	)
recode ictocc (	5419	=	0	)
recode ictocc (	6111	=	0	)
recode ictocc (	6112	=	0	)
recode ictocc (	6113	=	0	)
recode ictocc (	6114	=	0	)
recode ictocc (	6121	=	0	)
recode ictocc (	6122	=	0	)
recode ictocc (	6123	=	0	)
recode ictocc (	6129	=	0	)
recode ictocc (	6130	=	0	)
recode ictocc (	6210	=	0	)
recode ictocc (	6221	=	0	)
recode ictocc (	6222	=	0	)
recode ictocc (	6223	=	0	)
recode ictocc (	6224	=	0	)
recode ictocc (	6310	=	0	)
recode ictocc (	6320	=	0	)
recode ictocc (	6330	=	0	)
recode ictocc (	6340	=	0	)
recode ictocc (	7112	=	0	)
recode ictocc (	7113	=	0	)
recode ictocc (	7114	=	0	)
recode ictocc (	7115	=	0	)
recode ictocc (	7119	=	0	)
recode ictocc (	7121	=	0	)
recode ictocc (	7122	=	0	)
recode ictocc (	7123	=	0	)
recode ictocc (	7124	=	0	)
recode ictocc (	7125	=	0	)
recode ictocc (	7126	=	0	)
recode ictocc (	7127	=	0	)
recode ictocc (	7131	=	0	)
recode ictocc (	7132	=	0	)
recode ictocc (	7211	=	0	)
recode ictocc (	7212	=	0	)
recode ictocc (	7213	=	0	)
recode ictocc (	7214	=	0	)
recode ictocc (	7215	=	0	)
recode ictocc (	7221	=	0	)
recode ictocc (	7222	=	0	)
recode ictocc (	7223	=	0	)
recode ictocc (	7224	=	0	)
recode ictocc (	7231	=	0	)
recode ictocc (	7232	=	0	)
recode ictocc (	7233	=	0	)
recode ictocc (	7234	=	0	)
recode ictocc (	7311	=	0	)
recode ictocc (	7312	=	0	)
recode ictocc (	7313	=	0	)
recode ictocc (	7314	=	0	)
recode ictocc (	7315	=	0	)
recode ictocc (	7316	=	0	)
recode ictocc (	7317	=	0	)
recode ictocc (	7318	=	0	)
recode ictocc (	7319	=	0	)
recode ictocc (	7321	=	0	)
recode ictocc (	7322	=	0	)
recode ictocc (	7323	=	0	)
recode ictocc (	7411	=	0	)
recode ictocc (	7412	=	0	)
recode ictocc (	7413	=	0	)
recode ictocc (	7421	=	0	)
recode ictocc (	7422	=	0	)
recode ictocc (	7511	=	0	)
recode ictocc (	7512	=	0	)
recode ictocc (	7513	=	0	)
recode ictocc (	7514	=	0	)
recode ictocc (	7515	=	0	)
recode ictocc (	7516	=	0	)
recode ictocc (	7521	=	0	)
recode ictocc (	7522	=	0	)
recode ictocc (	7523	=	0	)
recode ictocc (	7531	=	0	)
recode ictocc (	7532	=	0	)
recode ictocc (	7533	=	0	)
recode ictocc (	7534	=	0	)
recode ictocc (	7535	=	0	)
recode ictocc (	7536	=	0	)
recode ictocc (	7541	=	0	)
recode ictocc (	7542	=	0	)
recode ictocc (	7543	=	0	)
recode ictocc (	7544	=	0	)
recode ictocc (	7549	=	0	)
recode ictocc (	8111	=	0	)
recode ictocc (	8112	=	0	)
recode ictocc (	8113	=	0	)
recode ictocc (	8114	=	0	)
recode ictocc (	8121	=	0	)
recode ictocc (	8122	=	0	)
recode ictocc (	8131	=	0	)
recode ictocc (	8132	=	0	)
recode ictocc (	8141	=	0	)
recode ictocc (	8142	=	0	)
recode ictocc (	8143	=	0	)
recode ictocc (	8151	=	0	)
recode ictocc (	8152	=	0	)
recode ictocc (	8153	=	0	)
recode ictocc (	8154	=	0	)
recode ictocc (	8155	=	0	)
recode ictocc (	8156	=	0	)
recode ictocc (	8157	=	0	)
recode ictocc (	8159	=	0	)
recode ictocc (	8160	=	0	)
recode ictocc (	8171	=	0	)
recode ictocc (	8172	=	0	)
recode ictocc (	8181	=	0	)
recode ictocc (	8182	=	0	)
recode ictocc (	8183	=	0	)
recode ictocc (	8189	=	0	)
recode ictocc (	8211	=	0	)
recode ictocc (	8212	=	0	)
recode ictocc (	8219	=	0	)
recode ictocc (	8311	=	0	)
recode ictocc (	8312	=	0	)
recode ictocc (	8321	=	0	)
recode ictocc (	8322	=	0	)
recode ictocc (	8331	=	0	)
recode ictocc (	8332	=	0	)
recode ictocc (	8341	=	0	)
recode ictocc (	8342	=	0	)
recode ictocc (	8343	=	0	)
recode ictocc (	8344	=	0	)
recode ictocc (	8350	=	0	)
recode ictocc (	9111	=	0	)
recode ictocc (	9112	=	0	)
recode ictocc (	9121	=	0	)
recode ictocc (	9122	=	0	)
recode ictocc (	9123	=	0	)
recode ictocc (	9129	=	0	)
recode ictocc (	9211	=	0	)
recode ictocc (	9212	=	0	)
recode ictocc (	9213	=	0	)
recode ictocc (	9214	=	0	)
recode ictocc (	9215	=	0	)
recode ictocc (	9216	=	0	)
recode ictocc (	9311	=	0	)
recode ictocc (	9312	=	0	)
recode ictocc (	9313	=	0	)
recode ictocc (	9321	=	0	)
recode ictocc (	9329	=	0	)
recode ictocc (	9331	=	0	)
recode ictocc (	9332	=	0	)
recode ictocc (	9333	=	0	)
recode ictocc (	9334	=	0	)
recode ictocc (	9411	=	0	)
recode ictocc (	9412	=	0	)
recode ictocc (	9510	=	0	)
recode ictocc (	9520	=	0	)
recode ictocc (	9611	=	0	)
recode ictocc (	9612	=	0	)
recode ictocc (	9613	=	0	)
recode ictocc (	9621	=	0	)
recode ictocc (	9622	=	0	)
recode ictocc (	9623	=	0	)
recode ictocc (	9624	=	0	)
recode ictocc (	9629	=	0	)

recode ictocc 1100/9999=.

label variable ictocc "In ICT occupation"


label define industry /// 
1 "Agriculture, fishing" ///
2 "Arts, entertainment" ///
3 "Community, social services" ///
4 "Construction" ///
5 "Consumer or wholesale trade" ///
6 "Electricity, gas and water" ///
7 "Finances and insurance" ///
8 "Hospitality and hotels" ///
9 "Industry and manufacturing" ///
10 "ICT" ///
11 "Mining and extraction" ///
12 "Other" ///
13 "Professional, scientific" ///
14 "Real Estate" ///
15 "Transport or warehousing", modify
label values industry industry

gen cosmopolitan01 = (cosmopolitan+1.32)/3.2
gen cosmopolitan201 = (cosmopolitan2+1.30)/3.15
label variable cosmopolitan201 "Cosmopolitan values"

label variable nextgen_knowledge "Next Generation knowledge"
label variable nextgen_growth "Impact on growth"
label variable nextgen_cons_avg "Impact on groups"

label define cognitive 0 "Not cognitive" 1 "Cognitive", modify
label values cogcreat cognitive
label values cogcreatB cognitive


foreach var in Webb_ai_score Webb_software_score Webb_robot_score Brynjolfson ///
Felten Meindl RTI_Autor techworkuse{
sum `var'
scalar min = r(min)
scalar max = r(max)
gen `var'01=(`var'-min)/(max-min)
}

*recode techworkuse 1=0 2=0.25 3=0.5 4=0.75 5=1, gen(techworkuse01)
label variable techworkuse01 "Technology use at work"

label variable Webb_ai_score01 "AI exposure Webb"
label variable Webb_software_score01 "Software exposure Webb" 
label variable Webb_robot_score01 "Robot exposure Webb"
label variable RTI_Autor01 "Routine task intensity Autor"
label variable Brynjolfson01 "Suitability machine learning Brynjolfson"
label variable Felten01 "AI  exposure Felten"
label variable Meindl01 "Exposure Fourth Ind. Rev. Meindl"

label variable cosmopolitan01 "Cosmopolitan values"



gen redistribution = (redist2 + redist3 + redist4)/3
label variable redistribution "Redistribution"

********************************************************************************

***Order
gen iiiiiii_sociodemographics=.
gen iiiiiii_attitudinal=.
gen iiiiiii_technological=.
gen iiiiiii_experiment1=.
gen iiiiiii_experiment2=.
gen iiiiiii_experiment2recodes=.
gen iiiiiii_experiment3=.

*Sociodemographics
order 	gender  age age_group age_group_3 ///
	edu3c education ///
	empl6c unemployed /// 
	born country order ///
	place sector sector2 ///
	income income_quartile  ///
	region_nuts1 region_nuts3 ///
	industrypre industry_id ictindustry industry ictocc  ///
	occupation occupation_1d occupation1d occupationenc ///
	 cogcreat cogcreatB  /// 
	 Felten Felten_w Felten01 /// 
	 Webb_agg_pairs Webb_ai_score Webb_software_score Webb_robot_score ///
	 Webb_agg_pairs_w Webb_ai_score_w Webb_software_score_w Webb_robot_score_w ///
	 Webb_ai_score01 Webb_software_score01 Webb_robot_score01 ///
	 Brynjolfson Brynjolfson_w Brynjolfson01 ///
	 Meindl Meindl01  RTI_Autor RTI_Autor01 Tolan Frey_Osborne      ///
	software_retail_job software_job retail_job ///
	older low_education low_security ///
	, after(iiiiiii_sociodemographics)

*Attitudinal
order voterecall party_coding voterecall2 left_wing_parties right_wing_parties intention_party_coding voteintfamily voteintention  subjectiveincome ///
	losingjob outsideoptions job_vulnerability ///
	trust_labor_unions trust_national_government ///
	trust_EU trust_large_companies trust_other_people trust_avg ///
	national_identity occupational_identity gender_identity  nationalism_proxy ///
	polinterest ///
	inttrade climate migrants gendervalues ///
	cosmopolitan cosmopolitan2 cosmopolitan01 cosmopolitan201  ///
	redist1 redist2 redist3 redist4 redist_avg, ///
	after(iiiiiii_attitudinal)

*Technology 
order   monitoring_category monitoring ///
	support_tech_protectionism_avg  ///
	subj_substitution_risk subj_substitution_risk_category ///
	learn1 learn2 learn3 techno_stressed1 techno_stressed2 techno_stress ///
	platformwork1 platformwork2 ///
	app_use_frequency appuse online_retailer_use_frequency onlineretailers ///
	worktasks tech_use_at_work_intensity techworkuse ///
	techoptimism  techoptimism01 tech_impact_on_work_intensity ///
	big_tech_sentiment techfirmsentiment  techfirmsentiment01 globotics  ///
 techworkuse01 , after(iiiiiii_technological)

*Experiment 1
order condition_exp1 exp_tradeunions exp_regulation exp_regulateplatforms exp_monitoring exp_amazon exp_algorithm, after(iiiiiii_experiment1)

*Experiment 2
order condition_exp2 condition_exp2_subgroups blockorder ///
	nextgen_knowledge nextgen_knowledge100 ///
	support_NG_digital_skills support_NG_companies support_NG_startups ///
	support_NG_5G support_NG_public_sector support_NG_social_services ///
	support_NG_avg ///
	nextgen_growth nextgen_growth10 ///
	nextgen_cons_manual nextgen_cons_cognitive_creative ///
	nextgen_cons_university nextgen_cons_young nextgen_cons_old ///
	nextgen_cons_urban nextgen_cons_rural nextgen_cons_avg ///
	gap_cogncreat gap_youngold gap_urbanrural ///
	impactgappre impactgap ///
	nextgen_cons_high nextgen_cons_low  ///
	nextgen_growth_predicted  nextgen_cons_avg_predicted   , after(iiiiiii_experiment2)

order exp3A exp3B exp3C education2 training1 training2 Rec_ech Rec_ech2  ///
, after(iiiiiii_experiment3)
	
*Recodes
	order support_NG_digital_skills10 - nextgen_university_3c, after (iiiiiii_experiment2recodes)

	ssc install oesch

*Note, to create the class scheme, we need information about the number of employees in the household and we don't have it

import delimited "/Users/aina/Dropbox/papers in progress/Next Gen/Data/raw_data_num.csv"
keep record q6
save "occupation.dta", replace

clear all
set mo off
cd "~/Dropbox/papers in progress/Next Gen/Data/"
use "sample_clean.dta", clear

merge 1:1 record using occupation.dta 
tab q6

recode q6 (1=1) (2=2) (3=2) (4=2) (9=1) , gen (emplrel)

encode occupation, generate(occstring)

iscooesch occ5oesch, isco(occstring) emplrel(emplrel) [five replace]

[five replace]
iscooesch occ8oesch, isco(occstring) [eight replace]

merge 


***Generating new variable KE winner
tab cogcreat edu3c
  
gen KEoccupation =0
recode KEoccupation 0=2 if cogcreat ==1 & edu3c==2
recode KEoccupation 0=2 if cogcreat ==1 & edu3c==3
recode KEoccupation 0=1 if cogcreat ==0 & edu3c==3
recode KEoccupation 0=1 if cogcreat ==0 & edu3c==2

label define KEoccupation 0 "Lower educated" 1 "Non-cognitive & high edu" 2 "Cognitive & high edu", modify
label values KEoccupation KEoccupation

***Relabeling voteintfamily and changing the order
recode voteintfamily (1=2) (2=1) (5=6) (6=5)

label define voteintfamily ///
	1 "Left-populist or far left" ///
	2 "Green" ///
	3 "Main Left" ///
	4 "Main Right" ///
	5 "Right-populist or far right" ///
	6 "Not classifiable" , modify
label values voteintfamily voteintfamily
 

tab voteintfamily
tab voteintfamily, nol

drop training_intensity

save "sample_clean.dta", replace




